from flask_restful import Api

from .user import UserApi, user_bp, UserListApi, LoginApi
from .demo import DemoApi, demo_bp

api = Api()

api.add_resource(DemoApi, '/demo', '/', '/hello')
api.add_resource(UserApi, '/user', '/user/<int:id>')
api.add_resource(UserListApi, '/users')
api.add_resource(LoginApi, '/login')


def init_app(app):
    app.register_blueprint(user_bp)
    app.register_blueprint(demo_bp)
    api.init_app(app)
    print("imported apis")
